/**  

* @ClassName: DateUtil  

* @Description: TODO(这里用一句话描述这个类的作用)  

* @author windows  

* @date 2021年8月31日  

*/  
package com.xhkj.util;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author windows
 *
 */
public class DateUtil {
	public static String getToday(Date d) {
		DateFormat format = new SimpleDateFormat("yyyyMMdd");
		String now =  format.format(d);
		return now;
	}
	public static String getTommorrow(Date d) {
		DateFormat format = new SimpleDateFormat("yyyyMMdd");
		Calendar calendar = Calendar.getInstance();  
	    calendar.setTime(d);  
	    calendar.add(Calendar.DAY_OF_MONTH, +1);//明天
		
		String tommorw= format.format(calendar.getTime());
		return tommorw;
	}
	public static Date getHistory(int i) {
		Calendar calendar = Calendar.getInstance();
		calendar.add(Calendar.DAY_OF_YEAR, i);
		Date date = calendar.getTime();
		return date;
	}
}
